package example.main;

import tests.ApplicationTests;
import example.plugins.automaton.ConwayAutomatonPlugin;
import example.plugins.visualization.ConwayVisualizationPlugin;
import framework.GUI.MainFrame;
import framework.automaton.Mapping;
import framework.automaton.Updater;
import framework.automaton.plugin.AutomatonPlugin;
import framework.automaton.plugin.VisualizationPlugin;


/**
 * Class is the driver of the program, puts everything together and runs it
 * @author Bill Ge, May Zhai, Alex Yoo
 * 
 */
public class Driver implements DriverInterface {
	/**
	 * Method will create the framework and connect the framework to at least two plugins
	 * @param args
	 */
	public static void main(String [] args){
		Driver d = new Driver();
		d.createGame();
		
		//optional method to run in order to run the optional Tests of our framework/plugin
		runTests();
	}
	/**
	 * helper method to run the optional tests on our framework
	 */
	public static void runTests(){
		ApplicationTests.optionalTests();
	}

	public void createGame() {
		//create first plugin
		AutomatonPlugin a = new ConwayAutomatonPlugin();
		int limit = 10;
		Updater updater = a.createUpdater(limit);
		
		//create second plugin
		VisualizationPlugin v = new ConwayVisualizationPlugin();
		v.createVisualizations();
		Mapping temp = v.getMappings();
		
		//create framework
		MainFrame gui = new MainFrame(updater, v.getMappings());
	}
}
